<?php
/**
 * Created by: Dmitriy Demianchuk (d.demianchuk@gmail.com)
 * Date: 10.01.12 22:42
 */

class ImageUploadController extends AController
{
	private $_imagesFolder = 'userfiles';
	private $_maxFileSize;

	public function __construct($id, $module){
		$this->_maxFileSize = 3 * 1024 * 1024;
		parent::__construct($id, $module);
	}

	public function actionList(){
		Yii::import('adminArea.components.ATableEditor.Elements.ImageInput.*');
		$imageUpload = new AImageUpload();
		echo $imageUpload->upload();
	}

	public function actionFormImageLoad(){
		$this->renderPartial('formImageLoad');
	}

	public function actionDeleteImage(){
		Yii::import('adminArea.components.ATableEditor.Elements.ImageInput.*');
		$imageUpload = new AImageUpload();
		echo $imageUpload->deleteImage($_GET['id']);
	}
}
